/*
 * @Author: Mcfly
 * @Date: 2021-07-25 15:55:50
 * @LastEditTime: 2021-07-27 10:49:31
 * @LastEditors: Please set LastEditors
 * @Description: 
 * @FilePath: \FTTfly\Ctrl\HeightCtrl.h
 * 本人github:https://github.com/McflyWZX
 */
#ifndef __HEIGHTCTRL_H_
#define __HEIGHTCTRL_H_

#include "stdint.h"
#include "PID.h"
#include "Height.h"

typedef struct
{
    PIDctrler PID_H;
    PIDctrler PID_Speed;
    float deltaT;
    float lastHeight;
    float throttle;
    uint16_t count;
} HeightCtrl;

HeightCtrl *HeightCtrl_Init(void);
float HeightCtrl_Trans(float expectHeight, Height *nowHeight);
void HeightCtrl_UpdateFrame(HeightCtrl *heightCtrl, Height *nowHeight, float expectHeight, float throttle);
void HeightCtrl_Clear(HeightCtrl *heightCtrl);

#endif
